$ = jQuery

$.fn.deserializeForm = (model) ->

    @each ->

        form = $ @

        ($ "input[name=#{key}], textarea[name=#{key}], select[name=#{key}]", form).val model[key] for key in model.constructor.attributes